package com.ksc.storekeeper.client.presenter;

import com.google.gwt.event.shared.EventBus;
import com.google.inject.Inject;
import com.gwtplatform.mvp.client.Presenter;
import com.gwtplatform.mvp.client.TabData;
import com.gwtplatform.mvp.client.TabDataBasic;
import com.gwtplatform.mvp.client.annotations.NameToken;
import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
import com.gwtplatform.mvp.client.annotations.TabInfo;
import com.gwtplatform.mvp.client.annotations.TitleFunction;
import com.gwtplatform.mvp.client.proxy.RevealContentEvent;
import com.gwtplatform.mvp.client.proxy.TabContentProxyPlace;
import com.ksc.storekeeper.client.mvp.NameTokens;
import com.ksc.storekeeper.client.mvp.StoreKeeperGinInjector;
import com.ksc.storekeeper.client.presenter.ShowRoomItemsPresenter.ShowRoomItemsProxy;
import com.ksc.storekeeper.client.view.ShowRoomItemsView;

public class ShowRoomItemsPresenter extends Presenter<ShowRoomItemsView, ShowRoomItemsProxy> {

	@Inject
	public ShowRoomItemsPresenter(EventBus eventBus, ShowRoomItemsView view, ShowRoomItemsProxy proxy) {
		super(eventBus, view, proxy);

	}

	@ProxyCodeSplit
	@NameToken(NameTokens.ITEMS_SHOWROOM)
	public interface ShowRoomItemsProxy extends TabContentProxyPlace<ShowRoomItemsPresenter> {

	}

	@TabInfo(container = MyShowRoomPresenter.class)
	static TabData getTabLabel(StoreKeeperGinInjector ginjector) {
		return new TabDataBasic(ginjector.getStoreKeeperConstants().items(), 0);
	}

	@Override
	protected void revealInParent() {
		RevealContentEvent.fire(this, MyShowRoomPresenter.TYPE_SetTabContent, this);
	}

	@Override
	protected void onReveal() {
		super.onReveal();
	}

	@TitleFunction
	public String getTranslatedTitle(StoreKeeperGinInjector gInjector) {
		return gInjector.getStoreKeeperConstants().items();
	}
}
